﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ShowBox : MonoBehaviour
{
    public GameObject MaskCol; 
    bool isFirst = true;
    // Start is called before the first frame update
    void Start()
    {
        
    }
    private void OnEnable()
    {
        if(isFirst)
        {
            isFirst = false;
            return;
        }
        if (!AdManager1.instance.ShieldAddress)
        {
            StartCoroutine("setCenter");
            CheckTouch.Show(resume);
        }
        else
        {
            resume();
            AdManager.single.ShowNative();
        }
    }
    IEnumerator setCenter()
    {
        yield return null;
        MaskCol.SetActive(true);
    }
    void resume()
    {
        Invoke("Close", 0.5f);
       
    }
    void Close()
    {
        MaskCol.SetActive(false);
    }
}
